package class_and_object.circle;

public class TestSimpleCircle {
    public static void main(String[] args) {
        Circle circle1 = new Circle();
        System.out.println("The area of the circle of radius " + circle1.r + " is " + circle1.getArea() );

        Circle circle2 = new Circle(25);
        System.out.println("The area of the circle of radius " + circle2.r + " is " + circle2.getArea() );

        Circle circle3 = new Circle(125);
        System.out.println("The area of the circle of radius " + circle3.r + " is " + circle3.getArea() );

        circle2.r = 100;
        System.out.println("The area of the circle of radius " + circle2.r + " is " + circle2.getArea() );

    }
}

class Circle{
    double r = 1;

    public Circle(){}
    public Circle(double r) {
        this.r = r;
    }

    public double getArea(){
        return 3.1415926 * r * r;
    }
    public double getPerimeter(){
        return 2 * 3.1415926 * r;
    }
    public double setNewR(double newR){
        r=newR;
        return r;
    }
}
